package main

import (
	"fmt"
	"net/http"
	"time"
	//"woo-server/coms/utils"
	"woo-server/coms/utils"
	"woo-server/routers"
	"woo-server/start/inits"

	"github.com/gin-gonic/gin"
)

// @title PMO API
// @version 1.0
// @description  pmo api of demo
// @contact.name API Support
func main() {
	//初始化路由信息
	r := gin.New()

	//路由绑定
	routers.RouterBindings(r)
	server := &http.Server{
		Addr:           utils.GetConfigValue(inits.ConfigHost), //监听端口
		Handler:        r,
		ReadTimeout:    30 * 60 * time.Second, //超时时间设置
		WriteTimeout:   30 * 60 * time.Second,
		MaxHeaderBytes: 1 << 20,
	}

	fmt.Printf("service listen on [%s]\r\n", utils.GetConfigValue(inits.ConfigHost))
	fmt.Println(server.ListenAndServe())

}
